package com.alibaba.fastjson.parser.deserializer;

import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.parser.DefaultJSONParser;
import com.alibaba.fastjson.parser.Feature;
import com.alibaba.fastjson.parser.JSONLexer;
import com.alibaba.fastjson.parser.JSONLexerBase;
import com.alibaba.fastjson.parser.ParseContext;
import com.alibaba.fastjson.parser.ParserConfig;
import com.alibaba.fastjson.util.FieldInfo;
import com.alibaba.fastjson.util.JavaBeanInfo;
import com.alibaba.fastjson.util.TypeUtils;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Proxy;
import java.lang.reflect.Type;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentMap;
import tv.danmaku.ijk.media.player.IjkMediaPlayer;

/* loaded from: classes.dex */
public class JavaBeanDeserializer implements ObjectDeserializer {
    private final Map<String, FieldDeserializer> alterNameFieldDeserializers;
    public final JavaBeanInfo beanInfo;
    protected final Class<?> clazz;
    private ConcurrentMap<String, Object> extraFieldDeserializers;
    private Map<String, FieldDeserializer> fieldDeserializerMap;
    private final FieldDeserializer[] fieldDeserializers;
    private transient long[] hashArray;
    private transient short[] hashArrayMapping;
    private transient long[] smartMatchHashArray;
    private transient short[] smartMatchHashArrayMapping;
    protected final FieldDeserializer[] sortedFieldDeserializers;

    @Override // com.alibaba.fastjson.parser.deserializer.ObjectDeserializer
    public int getFastMatchToken() {
        return 12;
    }

    public JavaBeanDeserializer(ParserConfig parserConfig, Class<?> cls) {
        this(parserConfig, cls, cls);
    }

    public JavaBeanDeserializer(ParserConfig parserConfig, Class<?> cls, Type type) {
        this(parserConfig, JavaBeanInfo.build(cls, type, parserConfig.propertyNamingStrategy, parserConfig.fieldBased, parserConfig.compatibleWithJavaBean, parserConfig.isJacksonCompatible()));
    }

    public JavaBeanDeserializer(ParserConfig parserConfig, JavaBeanInfo javaBeanInfo) {
        String[] strArr;
        this.clazz = javaBeanInfo.clazz;
        this.beanInfo = javaBeanInfo;
        this.sortedFieldDeserializers = new FieldDeserializer[javaBeanInfo.sortedFields.length];
        int length = javaBeanInfo.sortedFields.length;
        HashMap hashMap = null;
        int i = 0;
        while (i < length) {
            FieldInfo fieldInfo = javaBeanInfo.sortedFields[i];
            FieldDeserializer createFieldDeserializer = parserConfig.createFieldDeserializer(parserConfig, javaBeanInfo, fieldInfo);
            this.sortedFieldDeserializers[i] = createFieldDeserializer;
            if (length > 128) {
                if (this.fieldDeserializerMap == null) {
                    this.fieldDeserializerMap = new HashMap();
                }
                this.fieldDeserializerMap.put(fieldInfo.name, createFieldDeserializer);
            }
            HashMap hashMap2 = hashMap;
            for (String str : fieldInfo.alternateNames) {
                if (hashMap2 == null) {
                    hashMap2 = new HashMap();
                }
                hashMap2.put(str, createFieldDeserializer);
            }
            i++;
            hashMap = hashMap2;
        }
        this.alterNameFieldDeserializers = hashMap;
        this.fieldDeserializers = new FieldDeserializer[javaBeanInfo.fields.length];
        int length2 = javaBeanInfo.fields.length;
        for (int i2 = 0; i2 < length2; i2++) {
            this.fieldDeserializers[i2] = getFieldDeserializer(javaBeanInfo.fields[i2].name);
        }
    }

    public FieldDeserializer getFieldDeserializer(String str) {
        return getFieldDeserializer(str, null);
    }

    public FieldDeserializer getFieldDeserializer(String str, int[] iArr) {
        FieldDeserializer fieldDeserializer;
        if (str == null) {
            return null;
        }
        Map<String, FieldDeserializer> map = this.fieldDeserializerMap;
        if (map == null || (fieldDeserializer = map.get(str)) == null) {
            int i = 0;
            int length = this.sortedFieldDeserializers.length - 1;
            while (i <= length) {
                int i2 = (i + length) >>> 1;
                int compareTo = this.sortedFieldDeserializers[i2].fieldInfo.name.compareTo(str);
                if (compareTo < 0) {
                    i = i2 + 1;
                } else if (compareTo <= 0) {
                    if (isSetFlag(i2, iArr)) {
                        return null;
                    }
                    return this.sortedFieldDeserializers[i2];
                } else {
                    length = i2 - 1;
                }
            }
            Map<String, FieldDeserializer> map2 = this.alterNameFieldDeserializers;
            if (map2 != null) {
                return map2.get(str);
            }
            return null;
        }
        return fieldDeserializer;
    }

    public FieldDeserializer getFieldDeserializer(long j) {
        int i = 0;
        if (this.hashArray == null) {
            long[] jArr = new long[this.sortedFieldDeserializers.length];
            int i2 = 0;
            while (true) {
                FieldDeserializer[] fieldDeserializerArr = this.sortedFieldDeserializers;
                if (i2 >= fieldDeserializerArr.length) {
                    break;
                }
                jArr[i2] = TypeUtils.fnv1a_64(fieldDeserializerArr[i2].fieldInfo.name);
                i2++;
            }
            Arrays.sort(jArr);
            this.hashArray = jArr;
        }
        int binarySearch = Arrays.binarySearch(this.hashArray, j);
        if (binarySearch < 0) {
            return null;
        }
        if (this.hashArrayMapping == null) {
            short[] sArr = new short[this.hashArray.length];
            Arrays.fill(sArr, (short) -1);
            while (true) {
                FieldDeserializer[] fieldDeserializerArr2 = this.sortedFieldDeserializers;
                if (i >= fieldDeserializerArr2.length) {
                    break;
                }
                int binarySearch2 = Arrays.binarySearch(this.hashArray, TypeUtils.fnv1a_64(fieldDeserializerArr2[i].fieldInfo.name));
                if (binarySearch2 >= 0) {
                    sArr[binarySearch2] = (short) i;
                }
                i++;
            }
            this.hashArrayMapping = sArr;
        }
        short s = this.hashArrayMapping[binarySearch];
        if (s != -1) {
            return this.sortedFieldDeserializers[s];
        }
        return null;
    }

    static boolean isSetFlag(int i, int[] iArr) {
        if (iArr == null) {
            return false;
        }
        int i2 = i / 32;
        int i3 = i % 32;
        if (i2 < iArr.length) {
            if (((1 << i3) & iArr[i2]) != 0) {
                return true;
            }
        }
        return false;
    }

    public Object createInstance(DefaultJSONParser defaultJSONParser, Type type) {
        Object newInstance;
        ParseContext parseContext;
        FieldInfo[] fieldInfoArr;
        if ((type instanceof Class) && this.clazz.isInterface()) {
            return Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class[]{(Class) type}, new JSONObject());
        }
        if (this.beanInfo.defaultConstructor == null && this.beanInfo.factoryMethod == null) {
            return null;
        }
        if (this.beanInfo.factoryMethod == null || this.beanInfo.defaultConstructorParameterSize <= 0) {
            try {
                Constructor<?> constructor = this.beanInfo.defaultConstructor;
                if (this.beanInfo.defaultConstructorParameterSize != 0) {
                    ParseContext context = defaultJSONParser.getContext();
                    if (context == null || context.object == null) {
                        throw new JSONException("can't create non-static inner class instance.");
                    }
                    if (type instanceof Class) {
                        String name = ((Class) type).getName();
                        String substring = name.substring(0, name.lastIndexOf(36));
                        Object obj = context.object;
                        String name2 = obj.getClass().getName();
                        if (!name2.equals(substring) && (parseContext = context.parent) != null && parseContext.object != null && ("java.util.ArrayList".equals(name2) || "java.util.List".equals(name2) || "java.util.Collection".equals(name2) || "java.util.Map".equals(name2) || "java.util.HashMap".equals(name2))) {
                            obj = parseContext.object.getClass().getName().equals(substring) ? parseContext.object : null;
                        }
                        if (obj == null || ((obj instanceof Collection) && ((Collection) obj).isEmpty())) {
                            throw new JSONException("can't create non-static inner class instance.");
                        }
                        newInstance = constructor.newInstance(obj);
                    } else {
                        throw new JSONException("can't create non-static inner class instance.");
                    }
                } else if (constructor != null) {
                    newInstance = constructor.newInstance(new Object[0]);
                } else {
                    newInstance = this.beanInfo.factoryMethod.invoke(null, new Object[0]);
                }
                if (defaultJSONParser != null && defaultJSONParser.lexer.isEnabled(Feature.InitStringFieldAsEmpty)) {
                    for (FieldInfo fieldInfo : this.beanInfo.fields) {
                        if (fieldInfo.fieldClass == String.class) {
                            try {
                                fieldInfo.set(newInstance, "");
                            } catch (Exception e) {
                                throw new JSONException("create instance error, class " + this.clazz.getName(), e);
                            }
                        }
                    }
                }
                return newInstance;
            } catch (JSONException e2) {
                throw e2;
            } catch (Exception e3) {
                throw new JSONException("create instance error, class " + this.clazz.getName(), e3);
            }
        }
        return null;
    }

    @Override // com.alibaba.fastjson.parser.deserializer.ObjectDeserializer
    public <T> T deserialze(DefaultJSONParser defaultJSONParser, Type type, Object obj) {
        return (T) deserialze(defaultJSONParser, type, obj, 0);
    }

    public <T> T deserialze(DefaultJSONParser defaultJSONParser, Type type, Object obj, int i) {
        return (T) deserialze(defaultJSONParser, type, obj, null, i, null);
    }

    public <T> T deserialzeArrayMapping(DefaultJSONParser defaultJSONParser, Type type, Object obj, Object obj2) {
        Enum<?> scanEnum;
        JSONLexer jSONLexer = defaultJSONParser.lexer;
        if (jSONLexer.token() != 14) {
            throw new JSONException(IjkMediaPlayer.OnNativeInvokeListener.ARG_ERROR);
        }
        String scanTypeName = jSONLexer.scanTypeName(defaultJSONParser.symbolTable);
        if (scanTypeName != null) {
            ObjectDeserializer seeAlso = getSeeAlso(defaultJSONParser.getConfig(), this.beanInfo, scanTypeName);
            if (seeAlso == null) {
                seeAlso = defaultJSONParser.getConfig().getDeserializer(defaultJSONParser.getConfig().checkAutoType(scanTypeName, TypeUtils.getClass(type), jSONLexer.getFeatures()));
            }
            if (seeAlso instanceof JavaBeanDeserializer) {
                return (T) ((JavaBeanDeserializer) seeAlso).deserialzeArrayMapping(defaultJSONParser, type, obj, obj2);
            }
        }
        T t = (T) createInstance(defaultJSONParser, type);
        int i = 0;
        int length = this.sortedFieldDeserializers.length;
        while (true) {
            if (i >= length) {
                break;
            }
            char c = i == length + (-1) ? ']' : ',';
            FieldDeserializer fieldDeserializer = this.sortedFieldDeserializers[i];
            Class<?> cls = fieldDeserializer.fieldInfo.fieldClass;
            if (cls == Integer.TYPE) {
                fieldDeserializer.setValue((Object) t, jSONLexer.scanInt(c));
            } else if (cls == String.class) {
                fieldDeserializer.setValue((Object) t, jSONLexer.scanString(c));
            } else if (cls == Long.TYPE) {
                fieldDeserializer.setValue(t, jSONLexer.scanLong(c));
            } else if (cls.isEnum()) {
                char current = jSONLexer.getCurrent();
                if (current == '\"' || current == 'n') {
                    scanEnum = jSONLexer.scanEnum(cls, defaultJSONParser.getSymbolTable(), c);
                } else if (current >= '0' && current <= '9') {
                    scanEnum = ((EnumDeserializer) ((DefaultFieldDeserializer) fieldDeserializer).getFieldValueDeserilizer(defaultJSONParser.getConfig())).valueOf(jSONLexer.scanInt(c));
                } else {
                    scanEnum = scanEnum(jSONLexer, c);
                }
                fieldDeserializer.setValue(t, scanEnum);
            } else if (cls == Boolean.TYPE) {
                fieldDeserializer.setValue(t, jSONLexer.scanBoolean(c));
            } else if (cls == Float.TYPE) {
                fieldDeserializer.setValue(t, Float.valueOf(jSONLexer.scanFloat(c)));
            } else if (cls == Double.TYPE) {
                fieldDeserializer.setValue(t, Double.valueOf(jSONLexer.scanDouble(c)));
            } else if (cls == Date.class && jSONLexer.getCurrent() == '1') {
                fieldDeserializer.setValue(t, new Date(jSONLexer.scanLong(c)));
            } else if (cls == BigDecimal.class) {
                fieldDeserializer.setValue(t, jSONLexer.scanDecimal(c));
            } else {
                jSONLexer.nextToken(14);
                fieldDeserializer.setValue(t, defaultJSONParser.parseObject(fieldDeserializer.fieldInfo.fieldType, fieldDeserializer.fieldInfo.name));
                if (jSONLexer.token() == 15) {
                    break;
                }
                check(jSONLexer, c == ']' ? 15 : 16);
            }
            i++;
        }
        jSONLexer.nextToken(16);
        return t;
    }

    protected void check(JSONLexer jSONLexer, int i) {
        if (jSONLexer.token() != i) {
            throw new JSONException("syntax error");
        }
    }

    protected Enum<?> scanEnum(JSONLexer jSONLexer, char c) {
        throw new JSONException("illegal enum. " + jSONLexer.info());
    }

    /* JADX WARN: Code restructure failed: missing block: B:297:0x037a, code lost:
        if (r12.matchStat == (-2)) goto L593;
     */
    /* JADX WARN: Code restructure failed: missing block: B:387:0x04da, code lost:
        r2 = getSeeAlso(r13, r31.beanInfo, r1);
     */
    /* JADX WARN: Code restructure failed: missing block: B:388:0x04e0, code lost:
        if (r2 != null) goto L237;
     */
    /* JADX WARN: Code restructure failed: missing block: B:389:0x04e2, code lost:
        r15 = r13.checkAutoType(r1, com.alibaba.fastjson.util.TypeUtils.getClass(r33), r12.getFeatures());
        r2 = r32.getConfig().getDeserializer(r15);
     */
    /* JADX WARN: Code restructure failed: missing block: B:391:0x04f7, code lost:
        r15 = null;
     */
    /* JADX WARN: Code restructure failed: missing block: B:392:0x04f8, code lost:
        r3 = (T) r2.deserialze(r32, r15, r34);
     */
    /* JADX WARN: Code restructure failed: missing block: B:393:0x04fe, code lost:
        if ((r2 instanceof com.alibaba.fastjson.parser.deserializer.JavaBeanDeserializer) == false) goto L232;
     */
    /* JADX WARN: Code restructure failed: missing block: B:394:0x0500, code lost:
        r2 = (com.alibaba.fastjson.parser.deserializer.JavaBeanDeserializer) r2;
     */
    /* JADX WARN: Code restructure failed: missing block: B:395:0x0502, code lost:
        if (r4 == null) goto L232;
     */
    /* JADX WARN: Code restructure failed: missing block: B:396:0x0504, code lost:
        r2.getFieldDeserializer(r4).setValue((java.lang.Object) r3, r1);
     */
    /* JADX WARN: Code restructure failed: missing block: B:397:0x050b, code lost:
        if (r5 == null) goto L234;
     */
    /* JADX WARN: Code restructure failed: missing block: B:398:0x050d, code lost:
        r5.object = r35;
     */
    /* JADX WARN: Code restructure failed: missing block: B:399:0x0511, code lost:
        r32.setContext(r7);
     */
    /* JADX WARN: Code restructure failed: missing block: B:400:0x0514, code lost:
        return r3;
     */
    /* JADX WARN: Code restructure failed: missing block: B:405:0x0522, code lost:
        r16 = r1;
        r15 = r7;
        r1 = (T) r20;
        r36 = 0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:666:0x092c, code lost:
        throw new com.alibaba.fastjson.JSONException("syntax error, unexpect token " + com.alibaba.fastjson.parser.JSONToken.name(r12.token()));
     */
    /* JADX WARN: Removed duplicated region for block: B:294:0x0375  */
    /* JADX WARN: Removed duplicated region for block: B:295:0x0377 A[Catch: all -> 0x03c4, TRY_LEAVE, TryCatch #3 {all -> 0x03c4, blocks: (B:311:0x039f, B:313:0x03a9, B:316:0x03b6, B:327:0x03d1, B:329:0x03da, B:331:0x03e6, B:332:0x03ea, B:334:0x03f2, B:336:0x03f8, B:337:0x03fc, B:338:0x0408, B:341:0x0411, B:343:0x0415, B:344:0x0418, B:346:0x041c, B:347:0x041f, B:348:0x042b, B:350:0x0433, B:351:0x0439, B:353:0x043f, B:355:0x0445, B:356:0x044b, B:357:0x0451, B:358:0x0455, B:361:0x045d, B:373:0x048d, B:374:0x04a7, B:376:0x04aa, B:389:0x04e2, B:394:0x0500, B:396:0x0504, B:140:0x01e9, B:147:0x01f7, B:151:0x0204, B:157:0x0211, B:159:0x0215, B:162:0x021e, B:167:0x0228, B:170:0x0231, B:175:0x023b, B:178:0x0244, B:181:0x024a, B:186:0x0254, B:191:0x025e, B:196:0x0268, B:198:0x026e, B:201:0x027c, B:203:0x0284, B:205:0x0288, B:208:0x0296, B:213:0x02a1, B:216:0x02ab, B:221:0x02b6, B:224:0x02bf, B:229:0x02ca, B:232:0x02d3, B:235:0x02da, B:239:0x02e8, B:241:0x02f0, B:245:0x02fb, B:248:0x0300, B:244:0x02f7, B:251:0x0307, B:253:0x030f, B:257:0x031a, B:260:0x031f, B:256:0x0316, B:263:0x0325, B:267:0x0334, B:270:0x033a, B:266:0x0330, B:273:0x0340, B:275:0x0348, B:279:0x0353, B:282:0x0359, B:278:0x034f, B:285:0x035f, B:287:0x0365, B:292:0x0371, B:295:0x0377, B:291:0x036d), top: B:690:0x039f }] */
    /* JADX WARN: Removed duplicated region for block: B:307:0x0393  */
    /* JADX WARN: Removed duplicated region for block: B:39:0x0072 A[Catch: all -> 0x0049, TRY_LEAVE, TryCatch #8 {all -> 0x0049, blocks: (B:17:0x0039, B:19:0x003e, B:29:0x0055, B:31:0x0060, B:33:0x0068, B:39:0x0072, B:45:0x0082, B:50:0x008e, B:52:0x0098, B:55:0x009f, B:57:0x00a5, B:59:0x00b1, B:61:0x00bb, B:68:0x00ce, B:70:0x00d6, B:73:0x00e0, B:75:0x00e6, B:78:0x00ee, B:82:0x00fe, B:85:0x0111, B:89:0x011a, B:94:0x012b, B:95:0x0134, B:96:0x0135, B:98:0x0157, B:99:0x015f, B:100:0x0172, B:66:0x00c9, B:105:0x0179), top: B:697:0x0037, inners: #6 }] */
    /* JADX WARN: Removed duplicated region for block: B:413:0x0559  */
    /* JADX WARN: Removed duplicated region for block: B:415:0x0567 A[ADDED_TO_REGION] */
    /* JADX WARN: Removed duplicated region for block: B:429:0x059e  */
    /* JADX WARN: Removed duplicated region for block: B:456:0x0604  */
    /* JADX WARN: Removed duplicated region for block: B:476:0x0666  */
    /* JADX WARN: Removed duplicated region for block: B:477:0x0668 A[Catch: all -> 0x0936, TryCatch #15 {all -> 0x0936, blocks: (B:664:0x08fa, B:474:0x065e, B:477:0x0668, B:479:0x066e, B:659:0x08e9, B:661:0x08f1, B:665:0x090d, B:666:0x092c, B:465:0x063f, B:467:0x0645, B:469:0x064b, B:472:0x0656, B:667:0x092d, B:668:0x0935), top: B:710:0x08fa }] */
    /* JADX WARN: Removed duplicated region for block: B:678:0x094a  */
    /* JADX WARN: Removed duplicated region for block: B:695:0x0821 A[EXC_TOP_SPLITTER, SYNTHETIC] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    protected <T> T deserialze(com.alibaba.fastjson.parser.DefaultJSONParser r32, java.lang.reflect.Type r33, java.lang.Object r34, java.lang.Object r35, int r36, int[] r37) {
        /*
            Method dump skipped, instructions count: 2389
            To view this dump change 'Code comments level' option to 'DEBUG'
        */
        throw new UnsupportedOperationException("Method not decompiled: com.alibaba.fastjson.parser.deserializer.JavaBeanDeserializer.deserialze(com.alibaba.fastjson.parser.DefaultJSONParser, java.lang.reflect.Type, java.lang.Object, java.lang.Object, int, int[]):java.lang.Object");
    }

    protected Enum scanEnum(JSONLexerBase jSONLexerBase, char[] cArr, ObjectDeserializer objectDeserializer) {
        EnumDeserializer enumDeserializer = objectDeserializer instanceof EnumDeserializer ? (EnumDeserializer) objectDeserializer : null;
        if (enumDeserializer == null) {
            jSONLexerBase.matchStat = -1;
            return null;
        }
        long scanEnumSymbol = jSONLexerBase.scanEnumSymbol(cArr);
        if (jSONLexerBase.matchStat > 0) {
            Enum enumByHashCode = enumDeserializer.getEnumByHashCode(scanEnumSymbol);
            if (enumByHashCode == null) {
                if (scanEnumSymbol == -3750763034362895579L) {
                    return null;
                }
                if (jSONLexerBase.isEnabled(Feature.ErrorOnEnumNotMatch)) {
                    throw new JSONException("not match enum value, " + enumDeserializer.enumClass);
                }
            }
            return enumByHashCode;
        }
        return null;
    }

    public boolean parseField(DefaultJSONParser defaultJSONParser, String str, Object obj, Type type, Map<String, Object> map) {
        return parseField(defaultJSONParser, str, obj, type, map, null);
    }

    /* JADX WARN: Removed duplicated region for block: B:44:0x00d9  */
    /* JADX WARN: Removed duplicated region for block: B:96:0x01c6  */
    /* JADX WARN: Type inference failed for: r17v0 */
    /* JADX WARN: Type inference failed for: r17v1, types: [boolean, int] */
    /* JADX WARN: Type inference failed for: r17v3 */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    public boolean parseField(com.alibaba.fastjson.parser.DefaultJSONParser r22, java.lang.String r23, java.lang.Object r24, java.lang.reflect.Type r25, java.util.Map<java.lang.String, java.lang.Object> r26, int[] r27) {
        /*
            Method dump skipped, instructions count: 518
            To view this dump change 'Code comments level' option to 'DEBUG'
        */
        throw new UnsupportedOperationException("Method not decompiled: com.alibaba.fastjson.parser.deserializer.JavaBeanDeserializer.parseField(com.alibaba.fastjson.parser.DefaultJSONParser, java.lang.String, java.lang.Object, java.lang.reflect.Type, java.util.Map, int[]):boolean");
    }

    public FieldDeserializer smartMatch(String str) {
        return smartMatch(str, null);
    }

    /* JADX WARN: Removed duplicated region for block: B:38:0x0095  */
    /* JADX WARN: Removed duplicated region for block: B:54:? A[RETURN, SYNTHETIC] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    public com.alibaba.fastjson.parser.deserializer.FieldDeserializer smartMatch(java.lang.String r11, int[] r12) {
        /*
            r10 = this;
            r0 = 0
            if (r11 != 0) goto L4
            return r0
        L4:
            com.alibaba.fastjson.parser.deserializer.FieldDeserializer r1 = r10.getFieldDeserializer(r11, r12)
            if (r1 != 0) goto Laf
            long r2 = com.alibaba.fastjson.util.TypeUtils.fnv1a_64_lower(r11)
            long[] r4 = r10.smartMatchHashArray
            r5 = 0
            if (r4 != 0) goto L32
            com.alibaba.fastjson.parser.deserializer.FieldDeserializer[] r4 = r10.sortedFieldDeserializers
            int r4 = r4.length
            long[] r4 = new long[r4]
            r6 = 0
        L19:
            com.alibaba.fastjson.parser.deserializer.FieldDeserializer[] r7 = r10.sortedFieldDeserializers
            int r8 = r7.length
            if (r6 >= r8) goto L2d
            r7 = r7[r6]
            com.alibaba.fastjson.util.FieldInfo r7 = r7.fieldInfo
            java.lang.String r7 = r7.name
            long r7 = com.alibaba.fastjson.util.TypeUtils.fnv1a_64_lower(r7)
            r4[r6] = r7
            int r6 = r6 + 1
            goto L19
        L2d:
            java.util.Arrays.sort(r4)
            r10.smartMatchHashArray = r4
        L32:
            long[] r4 = r10.smartMatchHashArray
            int r2 = java.util.Arrays.binarySearch(r4, r2)
            if (r2 >= 0) goto L52
            java.lang.String r3 = "is"
            boolean r3 = r11.startsWith(r3)
            if (r3 == 0) goto L53
            r2 = 2
            java.lang.String r11 = r11.substring(r2)
            long r6 = com.alibaba.fastjson.util.TypeUtils.fnv1a_64_lower(r11)
            long[] r11 = r10.smartMatchHashArray
            int r2 = java.util.Arrays.binarySearch(r11, r6)
            goto L53
        L52:
            r3 = 0
        L53:
            if (r2 < 0) goto L92
            short[] r11 = r10.smartMatchHashArrayMapping
            r4 = -1
            if (r11 != 0) goto L81
            long[] r11 = r10.smartMatchHashArray
            int r11 = r11.length
            short[] r11 = new short[r11]
            java.util.Arrays.fill(r11, r4)
        L62:
            com.alibaba.fastjson.parser.deserializer.FieldDeserializer[] r6 = r10.sortedFieldDeserializers
            int r7 = r6.length
            if (r5 >= r7) goto L7f
            long[] r7 = r10.smartMatchHashArray
            r6 = r6[r5]
            com.alibaba.fastjson.util.FieldInfo r6 = r6.fieldInfo
            java.lang.String r6 = r6.name
            long r8 = com.alibaba.fastjson.util.TypeUtils.fnv1a_64_lower(r6)
            int r6 = java.util.Arrays.binarySearch(r7, r8)
            if (r6 < 0) goto L7c
            short r7 = (short) r5
            r11[r6] = r7
        L7c:
            int r5 = r5 + 1
            goto L62
        L7f:
            r10.smartMatchHashArrayMapping = r11
        L81:
            short[] r11 = r10.smartMatchHashArrayMapping
            short r11 = r11[r2]
            if (r11 == r4) goto L92
            boolean r12 = isSetFlag(r11, r12)
            if (r12 != 0) goto L92
            com.alibaba.fastjson.parser.deserializer.FieldDeserializer[] r12 = r10.sortedFieldDeserializers
            r11 = r12[r11]
            goto L93
        L92:
            r11 = r1
        L93:
            if (r11 == 0) goto Lb0
            com.alibaba.fastjson.util.FieldInfo r12 = r11.fieldInfo
            int r1 = r12.parserFeatures
            com.alibaba.fastjson.parser.Feature r2 = com.alibaba.fastjson.parser.Feature.DisableFieldSmartMatch
            int r2 = r2.mask
            r1 = r1 & r2
            if (r1 == 0) goto La1
            return r0
        La1:
            java.lang.Class<?> r12 = r12.fieldClass
            if (r3 == 0) goto Lb0
            java.lang.Class r1 = java.lang.Boolean.TYPE
            if (r12 == r1) goto Lb0
            java.lang.Class<java.lang.Boolean> r1 = java.lang.Boolean.class
            if (r12 == r1) goto Lb0
            r11 = r0
            goto Lb0
        Laf:
            r11 = r1
        Lb0:
            return r11
        */
        throw new UnsupportedOperationException("Method not decompiled: com.alibaba.fastjson.parser.deserializer.JavaBeanDeserializer.smartMatch(java.lang.String, int[]):com.alibaba.fastjson.parser.deserializer.FieldDeserializer");
    }

    private Object createFactoryInstance(ParserConfig parserConfig, Object obj) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {
        return this.beanInfo.factoryMethod.invoke(null, obj);
    }

    /* JADX WARN: Code restructure failed: missing block: B:133:0x0202, code lost:
        if (r11.beanInfo.fields[r12].fieldClass == java.lang.String.class) goto L190;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    public java.lang.Object createInstance(java.util.Map<java.lang.String, java.lang.Object> r12, com.alibaba.fastjson.parser.ParserConfig r13) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException {
        /*
            Method dump skipped, instructions count: 693
            To view this dump change 'Code comments level' option to 'DEBUG'
        */
        throw new UnsupportedOperationException("Method not decompiled: com.alibaba.fastjson.parser.deserializer.JavaBeanDeserializer.createInstance(java.util.Map, com.alibaba.fastjson.parser.ParserConfig):java.lang.Object");
    }

    public Type getFieldType(int i) {
        return this.sortedFieldDeserializers[i].fieldInfo.fieldType;
    }

    protected Object parseRest(DefaultJSONParser defaultJSONParser, Type type, Object obj, Object obj2, int i) {
        return parseRest(defaultJSONParser, type, obj, obj2, i, new int[0]);
    }

    protected Object parseRest(DefaultJSONParser defaultJSONParser, Type type, Object obj, Object obj2, int i, int[] iArr) {
        return deserialze(defaultJSONParser, type, obj, obj2, i, iArr);
    }

    protected static JavaBeanDeserializer getSeeAlso(ParserConfig parserConfig, JavaBeanInfo javaBeanInfo, String str) {
        if (javaBeanInfo.jsonType == null) {
            return null;
        }
        for (Class<?> cls : javaBeanInfo.jsonType.seeAlso()) {
            ObjectDeserializer deserializer = parserConfig.getDeserializer(cls);
            if (deserializer instanceof JavaBeanDeserializer) {
                JavaBeanDeserializer javaBeanDeserializer = (JavaBeanDeserializer) deserializer;
                JavaBeanInfo javaBeanInfo2 = javaBeanDeserializer.beanInfo;
                if (javaBeanInfo2.typeName.equals(str)) {
                    return javaBeanDeserializer;
                }
                JavaBeanDeserializer seeAlso = getSeeAlso(parserConfig, javaBeanInfo2, str);
                if (seeAlso != null) {
                    return seeAlso;
                }
            }
        }
        return null;
    }

    protected static void parseArray(Collection collection, ObjectDeserializer objectDeserializer, DefaultJSONParser defaultJSONParser, Type type, Object obj) {
        JSONLexerBase jSONLexerBase = (JSONLexerBase) defaultJSONParser.lexer;
        int i = jSONLexerBase.token();
        if (i == 8) {
            jSONLexerBase.nextToken(16);
            jSONLexerBase.token();
            return;
        }
        if (i != 14) {
            defaultJSONParser.throwException(i);
        }
        if (jSONLexerBase.getCurrent() == '[') {
            jSONLexerBase.next();
            jSONLexerBase.setToken(14);
        } else {
            jSONLexerBase.nextToken(14);
        }
        if (jSONLexerBase.token() == 15) {
            jSONLexerBase.nextToken();
            return;
        }
        int i2 = 0;
        while (true) {
            collection.add(objectDeserializer.deserialze(defaultJSONParser, type, Integer.valueOf(i2)));
            i2++;
            if (jSONLexerBase.token() != 16) {
                break;
            } else if (jSONLexerBase.getCurrent() == '[') {
                jSONLexerBase.next();
                jSONLexerBase.setToken(14);
            } else {
                jSONLexerBase.nextToken(14);
            }
        }
        int i3 = jSONLexerBase.token();
        if (i3 != 15) {
            defaultJSONParser.throwException(i3);
        }
        if (jSONLexerBase.getCurrent() == ',') {
            jSONLexerBase.next();
            jSONLexerBase.setToken(16);
            return;
        }
        jSONLexerBase.nextToken(16);
    }
}
